package com.xmj.cs.service.impl;

import com.xmj.cs.domain.Customers;
import com.xmj.cs.mapper.CustomersMapper;
import com.xmj.cs.service.ICustomersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 顾客Service业务层处理
 *
 * @author ohh
 * @date 2024-04-21
 */
@Service
public class CustomersServiceImpl implements ICustomersService
{
    @Autowired
    private CustomersMapper customersMapper;

    /**
     * 查询顾客
     *
     * @param customerID 顾客主键
     * @return 顾客
     */
    @Override
    public Customers selectCustomersByCustomerID(Long customerID)
    {
        return customersMapper.selectCustomersByCustomerID(customerID);
    }

    /**
     * 查询顾客列表
     *
     * @param customers 顾客
     * @return 顾客
     */
    @Override
    public List<Customers> selectCustomersList(Customers customers)
    {
        return customersMapper.selectCustomersList(customers);
    }

    /**
     * 新增顾客
     *
     * @param customers 顾客
     * @return 结果
     */
    @Override
    public int insertCustomers(Customers customers)
    {
        return customersMapper.insertCustomers(customers);
    }

    /**
     * 修改顾客
     *
     * @param customers 顾客
     * @return 结果
     */
    @Override
    public int updateCustomers(Customers customers)
    {
        return customersMapper.updateCustomers(customers);
    }

    /**
     * 批量删除顾客
     *
     * @param customerIDs 需要删除的顾客主键
     * @return 结果
     */
    @Override
    public int deleteCustomersByCustomerIDs(Long[] customerIDs)
    {
        return customersMapper.deleteCustomersByCustomerIDs(customerIDs);
    }

    /**
     * 删除顾客信息
     *
     * @param customerID 顾客主键
     * @return 结果
     */
    @Override
    public int deleteCustomersByCustomerID(Long customerID)
    {
        return customersMapper.deleteCustomersByCustomerID(customerID);
    }
}
